package mars.ColorPiano;

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JLabel;

public class ColoredLabel extends JLabel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Color mTextColor;
	private int mHeight;
	
	public ColoredLabel(String text, Color color, int height) {
		super(text);
		mTextColor = color;
		mHeight = height;
	}
	
	@Override
	protected void paintComponent(Graphics g) {
//		super.paintComponent(g);
		g.setFont(super.getFont());
		g.setColor(mTextColor);
		g.drawString(super.getText(), (super.getSize().width - super.getPreferredSize().width)/2, (super.getSize().height - super.getPreferredSize().height)/2);
	}
}
